/*
 * @Author: doing
 * @Date: 2023-09-07 19:33:57
 * @LastEditors: git config user.name && git config user.email
 * @LastEditTime: 2023-09-16 17:54:15
 * @FilePath: \水果新鲜识别项目\web-admin\src\api\user.js
 * @Description: 
 * 
 * Copyright (c) 2023 by 1540265624@qq.com, All Rights Reserved. 
 */
import axios from '~/axios'

//获取用户列表
function getUserList(param){
    console.log(param)
    return axios.get('/v1/user/page',{
        params: param
    })
}

//增加新用户
function addUser(body){
    return axios.post('/v1/user/create',body)
}


//更新用户
function updateUser(body){
    return axios.put('/v1/user/edit',body)
}



//删除用户
function deleteUser(id){
    return axios.delete(`/v1/user/del?id=${id}`)
}


//更新密码
function updatePassword(body){
    return axios.post('/v1/user/updatePwd',body)
}



//更新用户、角色表
function updateUserRole(body){
    return axios.put('/v1/user/updateRole',body)
}



export default {
    getUserList,
    addUser,
    updateUser,
    deleteUser,
    updateUserRole,
    updatePassword
}